package com.bonc.situation.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;

import com.bonc.situation.service.DataCollectionService;

/** 
* @Author guxf
* @Time 2020年12月26日 下午2:12:41 
* @Version 1.0
* <p>Description:数据定时采集，通过API</p>
*/
@Service
public class DataCollectionServiceImpl implements DataCollectionService {
	@Autowired
	private RestTemplate restTemplate;
	@Override
	public void syncData() {
		//TODO 
		//先查询数据库中是否存在
		//不存在插入
		//存在修改
		@SuppressWarnings("unused")
		String strBody = null;
		ResponseEntity<String> response = restTemplate.getForEntity("", String.class);
		if(response.getStatusCodeValue()==200){
			strBody=response.getBody();
			//解析成Bean
		}
		
	}
}
